<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Admin extends CI_Controller {
    
    function __construct()
    {
        parent::__construct();
    }
    
	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -  
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in 
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see http://codeigniter.com/user_guide/general/urls.html
	 */
	public function index()
	{
		if($this->session->userdata('admin_logged_in') == TRUE){
		    $this->main();
		}else{
		    redirect(base_url()."admin/auth/login");
		}
	}
	
	function main(){
		if($this->session->userdata('admin_logged_in') == FALSE){
		    redirect(base_url()."admin/auth/login");
		}
		
		$menu['menu_1'] = 'current';
		$menu['menu_2'] = '';
		$menu['menu_3'] = '';
		$menu['menu_4'] = '';
		$menu['menu_5'] = '';
		
		$this->template->set_template('admin');
		$this->template->write_view('menu','menu_view',$menu);
		$this->template->write_view('submenu','submenu_blank_view');
		$this->template->write_view('content','main_view');
		$this->template->render();
	}
}

/* End of file home.php */
/* Location: ./application/modules/admin/controllers/admin.php */